<?php
		if(isset($_POST['submit'])){
			$checkauth = My_auth::authenticate_user($_POST['username'] ,$_POST['password']);
			if($checkauth){
				$_SESSION['username'] = $_POST['username'];
				$_SESSION['is_logged_in'] = TRUE;
				header("location: " . $config['base_url']);
			} else {
				header("location: " . $config['base_url']);
			}
		}

?>
<div class ="login_form">
	<form class="login" method="post" action="" >
		<fieldset>
			<legend accesskey="l">Login</legend>
			<label for="username">Username :</label>
			<input type="text" name="username" autofocus required />
			<label for="password">Password :</label>
			<input type="password" name="password" />
			<input type="submit" value="Login" name="submit" id="login" />
		</fieldset>
	</form>
</div>